//
//  WBNavigationBar.swift
//  仿微博
//
//  Created by RaoBo on 2018/12/9.
//  Copyright © 2018年 RB. All rights reserved.
//

import UIKit

class WBNavigationBar: UINavigationBar {
    
    override func layoutSubviews() {
        super.layoutSubviews()
        for subview in self.subviews {
            let stringFromClass = NSStringFromClass(subview.classForCoder)
//            print("--------- \(stringFromClass)")
            if stringFromClass.contains("BarBackground") {
                subview.frame = self.bounds
            } else if stringFromClass.contains("UINavigationBarContentView") {
                subview.frame = CGRect(x: 0, y: 20, width: UIScreen.hm_screenWidth(), height: 44)
            }
        }
    }
    
//    作者：yqy159
//    链接：https://www.jianshu.com/p/f9c6a770d682
}
